﻿@model OShop.Models.OrderVatPart
@using OShop.Extensions

@{
    var numberFormat = WorkContext.NumberFormat();
}

<fieldset class="edit-order-details">
    <legend>@T("VAT")</legend>
    <table>
        <thead>
            <tr>
                <th>@T("Name")</th>
                <th>@T("Base")</th>
                <th>@T("Rate")</th>
                <th>@T("Total")</th>
            </tr>
        </thead>
        <tbody>
        @foreach (var amount in Model.VatAmounts) {
            <tr>
                <td>
                    @amount.Tax.Name
                </td>
                <td>
                    @String.Format(numberFormat, "{0:C}", amount.TaxBase)
                </td>
                <td>
                    @String.Format(numberFormat, "{0:P}", amount.Tax.Rate)
                </td>
                <td>
                    @String.Format(numberFormat, "{0:C}", amount.Tax.TaxAmount(amount.TaxBase))
                </td>
            </tr>
        }
        </tbody>
        <tfoot>
            @if (Model.VatAmounts.Any()) {
                <tr>
                    <th colspan="3">@T("VAT total")</th>
                    <td>@String.Format(numberFormat, "{0:C}", Model.SubTotal)</td>
                </tr>
            }
        </tfoot>
    </table>
</fieldset>


